package com.ruoyi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.TheWarningNotification;
import com.ruoyi.service.TheWariningNotificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/kangyue/UserNotification")
public class TheWarningNotificationController extends BaseController {

    @Autowired
    private TheWariningNotificationService theWariningNotificationService;

    /**
     * 获取异常内容
     *
     * @param userId 用户ID
     * @return 数据列表
     */
    @GetMapping("/usernotification")
    public TableDataInfo getUserNotification(@RequestParam Long userId) {
        List<TheWarningNotification> list = theWariningNotificationService.selectUserNotification(userId);
        return getDataTable(list);
    }
}